import request from "@/utils/request";

// 查询处方主表列表 (分页)
export function selectPagePrescriptionApply(query: any) {
    return request({
        url: "/business/prescriptionApply/selectPage",
        method: "get",
        params: query,
    });
}

// 查询处方主表列表 (不分页)
export function listPrescriptionApply(query: any) {
    return request({
        url: "/business/prescriptionApply/list",
        method: "get",
        params: query,
    });
}

// 查询处方主表详细
export function getPrescriptionApply(applyId: string) {
    return request({
        url: "/business/prescriptionApply/" + applyId,
        method: "get",
    });
}

// 新增处方主表
export function addPrescriptionApply(data: any) {
    return request({
        url: "/business/prescriptionApply",
        method: "post",
        data: data,
    });
}

// 保存处方模板
export function saveTemplateApply(data: any) {
    return request({
        url: "/business/prescriptionApply/saveTemplateApply",
        method: "post",
        data: data,
    });
}

// 获取处方追溯码药品信息
export function getPrescTraceabilityCodeList(data: any) {
    return request({
        url: "/business/prescriptionApply/getPrescTraceabilityCodeList",
        method: "post",
        data: data,
    });
}

// 修改处方主表
export function updatePrescriptionApply(data: any) {
    return request({
        url: "/business/prescriptionApply",
        method: "put",
        data: data,
    });
}

// 删除处方主表
export function delPrescriptionApply(applyId: string) {
    return request({
        url: "/business/prescriptionApply/" + applyId,
        method: "delete",
    });
}

// 申请退费
export function refundApplication(id: String, chargeFlag: String) {
    return request({
        url:
            "/business/prescriptionApply/refundApplication/" +
            id +
            "/" +
            chargeFlag,
        method: "get",
    });
}

// 查询处方主表列表（用于门诊输液处方列表展示） (不分页)
export function listPrescriptionApplyByInfusion(query: any) {
  return request({
    url: "/business/prescriptionApply/listPrescriptionApplyByInfusion",
    method: "get",
    params: query,
  });
}

